package com.zhiyou100.HomeWork;

import java.util.Scanner;

public class Factorial {
    public static void main(String[] args) {
        Scanner scr = new Scanner(System.in);
        System.out.println("请输入需要求阶乘的数：");
        int num = scr.nextInt(), s = 1;
        for(int i=1;i<=num;i++){
            s *= i;
        }
        System.out.println(num + "的阶乘为" + s);
    }
}
